package com.qfedu.microorder.recharge.controller;

import com.qfedu.common.core.common.R;
import com.qfedu.microorder.recharge.param.RechargeParam;
import com.qfedu.microorder.recharge.service.RechargeService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 调试一个初次见到的代码比重写代码要困难两倍。因此,按照定义,如果你写代码非常巧妙,那么没有人足够聪明来调试它。
 *
 * @author
 * @version 1.0
 * @date 2025/6/5 14:22
 */
@RestController
@RequestMapping("/order/recharge")
public class RechargeController {
    @Resource
    private RechargeService rechargeService;
    @PostMapping("/add")
    public R addRecharge(@RequestBody RechargeParam rechargeParam) {
        String orderNo = rechargeService.addRecharge(rechargeParam);
        System.out.println("订单号：" + orderNo);
        return R.ok(orderNo);
    }
}
